Skip to content

Conversation

@Bekiboo
Copy link
Collaborator

@Bekiboo Bekiboo commented Jan 19, 2026

Description of change

Automatically detects leading 0 and removes it.

Issue Number

Closes #681

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

On chrome, devtools, mobile

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes
    • Improved input handling for point and ranking fields: non-numeric characters are blocked, values are sanitized, and entries are constrained to the 0–100 range to prevent invalid submissions and display inconsistencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

This change updates the eVoting candidate scoring page: removes an unused import, changes point-vote inputs from number to text with inputMode="numeric", and adds sanitization onChange and onInput to enforce digits and clamp values to [0,100].

Changes

Cohort / File(s) Summary
Input handling and import
platforms/eVoting/src/app/(app)/[id]/page.tsx
Removed VotingInterface import. Changed point-vote input type from number to text (inputMode="numeric"). Added onChange sanitization (digits only, clamp 0–100) and onInput handler to enforce numeric-only value and update displayed input accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nudged a stubborn zero away,
Now numbers hop and freely play.
With tidy input, clamped and neat,
Votes spring forward on nimble feet. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: handling leading zeros in point voting input.
Description check ✅ Passed The description follows the template structure with all required sections completed: change description, issue number, type of change, testing method, and checklist fully marked.
Linked Issues check ✅ Passed The PR directly addresses issue #681 by implementing input sanitization that removes leading zeros and restricts input to numeric values [0, 100], meeting the requirement.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the leading zero issue in point voting input; no unrelated modifications detected beyond the stated objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Bekiboo Bekiboo marked this pull request as ready for review January 19, 2026 12:06
@Bekiboo Bekiboo requested a review from coodos as a code owner January 19, 2026 12:06
@Bekiboo Bekiboo self-assigned this Jan 19, 2026
Copy link
Contributor

@coodos coodos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change the input to a textbox, and totally just restrict it to numbers

@coodos coodos marked this pull request as draft January 20, 2026 09:30
@Bekiboo Bekiboo marked this pull request as ready for review January 20, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Cannot delete leading zero in candidate score field (points mode)

3 participants